package com.qingcheng.config;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.order.CategoryReportService;
import com.qingcheng.service.order.OrderService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author:boy
 * @Date:2019/6/28
 * @description:
 * @ModifiedBy:
 */
@Component
public class OrderTask {
    @Reference
    private OrderService orderService;
    @Reference
    private CategoryReportService categoryReportService;
    @Scheduled(cron = "0 0/2 * * * ?")
    public void orderTimeOutLogic(){
        System.out.println("=====执行订单超时处理任务====");
        orderService.orderTimeOutLogic();
    }
    @Scheduled(cron = "0 0 1 * * ?")
    public void createData(){
        System.out.println("========执行订单统计任务=======");
        categoryReportService.createData();
    }
}
